<?php

namespace App\Models\Enroll;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Enroll extends Model
{
    const CHECK_NULL = 0;//未审核
    const CHECK_PASS = 1;//通过
    const CHECK_NO_PASS = 2;//未通过

    const FROM_OLD_DATA = 0; //老数据
    const FROM_ADD = 1; //手动添加
    const FROM_ENROLLS = 2;//报名审核
    const FROM_ENROLLS_JSON = 3;//报名审核json格式

    use SoftDeletes;

    protected $dates = ['deleted_at'];

    protected $fillable = [
        "activities_id",
        "name",
        "mobile",
        "enrollPay",
        "content",
        "extfield",
    ];

    protected $casts = [
        "content" => "json",
        "extfield" => "json",
    ];

    public function activity()
    {
        return $this->belongsTo('\App\Models\Activity\Activity', 'activities_id', 'id');
    }
}
